= form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f|
  = hidden_field_tag :authenticity_token, form_authenticity_token
  .accept-merge-holder.clearfix.js-toggle-container
    .accept-action
      = f.button class: "btn btn-create accept_merge_request" do
        Accept Merge Request
    - if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
      .accept-control.checkbox
        = label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
          = check_box_tag :should_remove_source_branch
          Remove source-branch
    .accept-control
      = link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
        %i.fa.fa-edit
        Modify commit message
    .js-toggle-content.hide.prepend-top-20
      = render 'shared/commit_message_container', params: params,
          text: @merge_request.merge_commit_message,
          rows: 14, hint: true

  %br
  .light
    If you want to merge this request manually, you can use the
    %strong
      = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"

  :coffeescript
    $('.accept-mr-form').on 'ajax:before', ->
      btn = $('.accept_merge_request')
      btn.disable()
      btn.html("<i class='fa fa-spinner fa-spin'></i> Merge in progress")

